package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by hone on 17-4-13.
 */
@Entity
@Table(name = "request_log")
@DynamicInsert
@DynamicUpdate
public class RequestLog extends IDEntityMall {

    //操作人
    @Column(columnDefinition = "bigint comment '操作人'")
    private Long operatorId;
    //操作时间
    @Column(columnDefinition = "datetime comment '操作时间'")
    private Date operateDate;
    //操作的主机地址
    @Column(columnDefinition = "varchar(50) comment '地址'")
    private String address;
    //链接
    @Column(columnDefinition = "varchar(500) comment '链接'")
    private String url;
    //操作的方法名称
    @Column(columnDefinition = "varchar(38) comment '方法名称'")
    private String methodName;
    //调用方法时传递的参数值
    @Column(columnDefinition = "varchar(5000) comment '参数'")
    private String params;
    //调用结果
    @Column(columnDefinition = "varchar(18) comment '调用结果'")
    private String result;
    //描述
    @Column(columnDefinition = "MEDIUMTEXT comment '描述'")
    private String detail;
    //工程名称
    @Column(columnDefinition = "varchar(30) comment '工程名称'")
    private String appName;
    @Column(columnDefinition = "bigint comment '平台ID'")
    private Long mallId;
    @Column(columnDefinition = "bigint comment '商户ID'")
    private Long mechantId;

    public Long getOperatorId() {
        return operatorId;
    }

    public void setOperatorId(Long operatorId) {
        this.operatorId = operatorId;
    }

    public Long getMechantId() {
        return mechantId;
    }

    public void setMechantId(Long mechantId) {
        this.mechantId = mechantId;
    }

    public Date getOperateDate() {
        return operateDate;
    }

    public void setOperateDate(Date operateDate) {
        this.operateDate = operateDate;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String getParams() {
        return params;
    }

    public void setParams(String params) {
        this.params = params;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    @Override
    public String toString() {
        return "RequestLog{" +
                "operatorId=" + operatorId +
                ", operateDate=" + operateDate +
                ", address='" + address + '\'' +
                ", url='" + url + '\'' +
                ", methodName='" + methodName + '\'' +
                ", params='" + params + '\'' +
                ", result='" + result + '\'' +
                ", detail='" + detail + '\'' +
                ", appName='" + appName + '\'' +
                ", mallId=" + mallId +
                ", mechantId=" + mechantId +
                '}';
    }
}
